<?php
//yc@2009-10-24 20:07:59

class SettingController extends Controller
{
    public $models='Setting';

    public function index()
    {
        $config = $this->Setting->getAllConfig();
        $this->render(array('config' => $config, 'title' => _('设置')), 'index');
    }

    public function save()
    {
        global $PARAM;
        unset($PARAM['submit']);
        if (!empty($PARAM)){
            foreach ($PARAM as $name => $value)
                $this->Setting->update($name, htmlspecialchars($value));
        }
        $this->index();
    }
}
?>
